|
mruby 4.0.0
mruby is the lightweight implementation of the Ruby language
|


Go to the source code of this file.
Classes | |
| struct | mrb_irep_pool |
| struct | mrb_irep_catch_handler |
| struct | mrb_irep |
| struct | mrb_insn_data |
Macros | |
| #define | IREP_TT_NFLAG 1 /* number (non string) flag */ |
| #define | IREP_TT_SFLAG 2 /* static string flag */ |
| #define | MRB_ISEQ_NO_FREE 1 |
| #define | MRB_IREP_NO_FREE 2 |
| #define | MRB_IREP_STATIC (MRB_ISEQ_NO_FREE | MRB_IREP_NO_FREE) |
| #define | MRB_IREP_CONSOLIDATED 4 /* pool/syms/reps packed with irep struct */ |
| #define | mrb_irep_catch_handler_pack(n, v) |
| #define | mrb_irep_catch_handler_unpack(v) |
Typedefs | |
| typedef struct mrb_irep_pool | mrb_irep_pool |
Enumerations | |
| enum | irep_pool_type { IREP_TT_STR = 0 , IREP_TT_SSTR = 2 , IREP_TT_INT32 = 1 , IREP_TT_INT64 = 3 , IREP_TT_BIGINT = 7 , IREP_TT_FLOAT = 5 } |
| Compiled mruby scripts. | |
| enum | mrb_catch_type { MRB_CATCH_RESCUE = 0 , MRB_CATCH_ENSURE = 1 } |
Functions | |
| mrb_irep * | mrb_add_irep (mrb_state *mrb) |
| mrb_value | mrb_load_irep (mrb_state *, const uint8_t *) |
| load mruby bytecode functions | |
| mrb_value | mrb_load_irep_buf (mrb_state *, const void *, size_t) |
| mrb_value | mrb_load_irep_cxt (mrb_state *, const uint8_t *, mrb_ccontext *) |
| mrb_value | mrb_load_irep_buf_cxt (mrb_state *, const void *, size_t, mrb_ccontext *) |
| void | mrb_irep_incref (mrb_state *, struct mrb_irep *) |
| void | mrb_irep_decref (mrb_state *, struct mrb_irep *) |
| void | mrb_irep_cutref (mrb_state *, struct mrb_irep *) |
| #define mrb_irep_catch_handler_pack | ( | n, | |
| v ) |
| #define mrb_irep_catch_handler_unpack | ( | v | ) |
load mruby bytecode functions
Please note! Currently due to interactions with the GC calling these functions will leak one RProc object per function call. To prevent this save the current memory arena before calling and restore the arena right after, like so
int ai = mrb_gc_arena_save(mrb); mrb_value status = mrb_load_irep(mrb, buffer); mrb_gc_arena_restore(mrb, ai);
Also, when called from a C function defined as a method, the current stack is destroyed. If processing continues after this function, the objects obtained from the arguments must be protected as needed before this function.